<style>
   .footer-home{display: none}
   .scrollpics input{width:8rem;}
   .home-slide{margin-top:1.32rem;}
   header .search_icon{
       font-size: 0.5rem;
       position: absolute;
       top: 0.3rem;
       left: 2.9rem;
   }
   .swiper-pagination-bullet-active{
       background:#129aee!important;
   }
   .swiper-pagination{text-align:right!important;}
   .swiper-pagination-bullet{width:6px!important;height:6px!important;}
   .swiper-container-horizontal>.swiper-pagination-bullets{bottom:2px!important;}
   .swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 3px!important;}
  /* #move{position: relative;top: 0!important;left:0;}*/
   .sw-bullet{text-align:right;width:95%:margin-right:0.45rem;}
</style>
<link rel="stylesheet" href="resource/css/swiper.min.css" />
<script type="text/javascript" src="resource/js/swiper.min.js" ></script>


<header>
    <img src="<?php echo 'resource/images/LOGO_2@3x.png'; ?>" alt="六盘水logo">
    <div class="search_new">
        <span class="search_icon  iconfont icon-search"></span>
        <form action="index.php" id="search_1">
        <input type="text" name="keyword"  placeholder="搜索酒店/景区/美食/目的地"/>
        <select name="act">
            <option value="hotel">酒店</option>
            <option value="itinerary">旅游</option>
            <option value="ticket">景区</option>
            <option value="food">美食</option>
        </select>
        </form>
    </div>
</header>

<div id="move">
    <div class="home-slide swiper-container">
        <ul class="slider swiper-wrapper">
        <?php foreach ($output['ads_list'] as $adv): ?>
            <li class="swiper-slide" onclick='app_img_click(<?php echo json_encode($adv);  ?>)'><img src="<?php echo $adv['thumbs'][0]; ?>" /></li>
        <?php endforeach; ?>
    </ul>
    <div class="swiper-pagination"></div>
   </div>
</div>
<!--二级分类-->
<div class="tab_sort" style="display: none;">
        <ul>
            <?php foreach($output['news_cate'] as $key => $value): ?>

                <li onclick='app_event(<?php echo json_encode($value); ?>)'>
                <img src="<?php echo $value['img_l']; ?>">
                <p><?php echo $value['name']; ?></p>
                </li>
            <?php endforeach; ?>
        </ul>

    </div>

<!--二级分类结束-->

<div class="hotel_main footer_bottom flex-display" style="margin-top: 60px;">
    <div class="voice_index flex-1" onclick="window.location.href='index.php?act=map&op=ticket_map'"><a href="index.php?act=map&op=ticket_map"><i class="iconfont icon-yuyin1"></i>语音导游</a></div>
    <div class="hotel_index flex-1">
        <a class="hotel_a" href="index.php?act=hotel">
            <div class="hotel_logo fl">
                <span class="hotel_txt ">酒店预定</span>
                <span><i id="logo_icon" class=" iconfont icon-swt-icon-jiudian"></i></span>
             </div>
        </a>
        <?php if($output['cates']){ ?>
          <?php foreach ($output['cates']['hotel'] as $key => $vo){?>
                <a href="index.php?act=hotel&op=index&cate_id=<?php echo $vo['tc_id']; ?>" class="<?php echo $key%2==0?'hotel_logo':''; ?>  hotel_txt hotel_bottom fl"><?php echo $vo['tc_name']; ?></a>
            <?php } ?>
          <?php  }?>
    </div>
    <div class="travel_index flex-1">
        <a class="hotel_a" href="index.php?act=itinerary">
            <div class="hotel_logo fl">
                <span class="hotel_txt ">旅游定制</span>
                <span><i id="logo_icon_1" class=" iconfont icon-lunchuan"></i></span>
            </div>
        </a>
        <?php if($output['cates']){ ?>
            <?php foreach ($output['cates']['itinerary'] as $key => $vo){?>
                <a href="index.php?act=itinerary&op=index&cate_id=<?php echo $vo['tc_id']; ?>" class="<?php echo $key%2==0?'hotel_logo':''; ?>  hotel_txt hotel_bottom fl"><?php echo $vo['tc_name']; ?></a>
            <?php } ?>
        <?php  }?>
    </div>
    <div class="scenic_index flex-1">
        <a class="hotel_a" href="index.php?act=ticket">
            <div class="hotel_logo fl">
                <span class="hotel_txt ">景区门票</span>
                <span><i id="logo_icon_2" class=" iconfont icon-jingdian"></i></span>
            </div>
        </a>
        <?php if($output['cates']){ ?>
            <?php foreach ($output['cates']['ticket'] as $key => $vo){?>
                <a href="index.php?act=ticket&op=index&cate_id=<?php echo $vo['tc_id']; ?>" class="<?php echo $key%2==0?'hotel_logo':''; ?>  hotel_txt hotel_bottom fl"><?php echo $vo['tc_name']; ?></a>
            <?php } ?>
        <?php  }?>
    </div>
    <div class="food_index flex-1">
        <a class="hotel_a" href="index.php?act=food">
            <div class="hotel_logo fl">
                <span class="hotel_txt ">美食美购</span>
                <span><i id="logo_icon_3" class="iconfont icon-shitang-"></i></span>
            </div>
        </a>
        <?php if($output['cates']){ ?>
            <?php foreach ($output['cates']['food'] as $key => $vo){?>
                <a href="index.php?act=food&op=search&cate_id=<?php echo $vo['tc_id']; ?>" class="<?php echo $key%2==0?'hotel_logo':''; ?>  hotel_txt hotel_bottom fl"><?php echo $vo['tc_name']; ?></a>
            <?php } ?>
        <?php  }?>
    </div>

    <!--<div class="xiecheng_index">
                <a class="hotel_a" href="http://www.ctrip.com/">
                    <div class="hotel_logo fl">
                        <span class="hotel_txt ">携程</span>
                        <span><i id="logo_icon_4" class="iconfont icon-xiecheng"></i></span>
                    </div>
                </a>
                <a href="http://www.ctrip.com/" class="hotel_logo hotel_txt hotel_bottom fl">火车票</a>
                <a href="http://www.ctrip.com/" class="hotel_txt hotel_bottom fl">汽车票·船票</a>
                <a href="http://www.ctrip.com/" class="hotel_logo hotel_txt hotel_bottom fl">特价机票</a>
                <a href="http://www.ctrip.com/" class="hotel_txt hotel_bottom fl">专车·租车</a>
            </div>-->
</div>
</div>
<div class="index_tab">
    <ul>
        <a href="index.php?act=localimg&op=zzb"><li ><i class="iconfont icon-shouzhang"></i><b>掌中宝</b></li></a>
        <a href="index.php?act=localimg&op=zx"><li><i class="iconfont icon-zixun_shi"></i><b>资讯</b></li></a>
        <a ><li class="color_blue"><i class="iconfont icon-shangcheng_shi"></i><b>商城</b></li></a>
        <a href="index.php?act=localimg&op=sq"><li><i class="iconfont icon-shequ_shi"></i><b>社区</b></li></a>
        <a href="index.php?act=localimg&op=member"><li><i class="iconfont icon-wo_shi"></i><b>我</b></li></a>
    </ul>
</div>

<script>
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        loop: true,
        autoplay: 3000,
        autoplayDisableOnInteraction: false

    });

    window.app && $('.index_tab').hide() && $('.tab_sort').show() && $('.home-slide').show() && $('.hotel_main').css({"margin-top":0});
    window.webkit && $('.index_tab').hide() && $('.tab_sort').show() && $('.home-slide').show() &&　$('.hotel_main').css({"margin-top":0});
    <?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false): ?>
    $('.index_tab').hide();
    $('.tab_sort').hide();
    $('.home-slide').hide();
    $('.hotel_main').css({"margin-top":60px})
    <?php endif; ?>

    //app端方法
    function app_event(obj)
    {
        //console.log(JSON.stringify(obj));
        window.app && window.app.AppChannel(JSON.stringify(obj));
        window.webkit && window.webkit.messageHandlers.AppChannel.postMessage(JSON.stringify(obj));
    }

    function app_img_click(obj)
    {
        //console.log(obj);
        window.app && window.app.AppAd(JSON.stringify(obj));
        window.webkit && window.webkit.messageHandlers.AppAd.postMessage(JSON.stringify(obj));
    }


</script>

<?php if ($_SESSION['pos']['js'] == false && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') == false): ?>
<script src="//webapi.amap.com/maps?v=1.4.3&key=e5c438490a60083b210b012342ff9339"></script>
<script src="//cache.amap.com/lbs/static/es5.min.js"></script>
<script>
    var mapObj = new AMap.Map('iCenter');
    var  geolocation;
    mapObj.plugin('AMap.Geolocation', function () {
        geolocation = new AMap.Geolocation({
            enableHighAccuracy: true,//是否使用高精度定位，默认:true
            timeout: 100000,          //超过10秒后停止定位，默认：无穷大
            maximumAge: 10000,           //定位结果缓存0毫秒，默认：0
            convert: true           //自动偏移坐标，偏移后的坐标为高德坐标，默认：true
        });

        geolocation.getCurrentPosition();
        mapObj.addControl(geolocation);
        AMap.event.addListener(geolocation, 'complete', onComplete); //返回定位信息
        AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
    });

    //获取经纬度
    function onComplete(data) {
        console.log(data.position.getLng());
        console.log(data.position.getLat());
        var lng = data.position.getLng();//经度
        var lat = data.position.getLat();//纬度
        $.getJSON('index.php?act=location&op=ajax',{lng:lng,lat:lat},function(json){
            /*json.reloads && json.city && popAlert('定位到'+json.city+'，将为您切换到'+json.city, function () {
             location.reload();
             }, 0);*/
            //json.reloads && json.city && location.reload();
        });
    }
    function onError(data) {
        console.log(data);
        //popAlert('您禁用了定位' + e.message);
    }
</script>
<?php endif; ?>

